package dimension.starry.mixin;

import dimension.starry.entity.Attributes;
import dimension.starry.event.Events;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.attribute.DefaultAttributeContainer;
import net.minecraft.entity.mob.HostileEntity;
import net.minecraft.nbt.NbtCompound;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

@Mixin(value = {HostileEntity.class}, priority = 1001)
public abstract class HostileEntityMixin {

    @Inject(method = "createHostileAttributes", at = @At("RETURN"), cancellable = true)
    private static void onCreateAttribute(CallbackInfoReturnable<DefaultAttributeContainer.Builder> cir) {
        cir.setReturnValue(cir.getReturnValue().add(Attributes.MONSTER_LEVEL.getAttribute()));
    }

}
